<template>

        <table>
                    <tr>
                        <th>职员姓名</th>
                        <th>
                                <input type="text" v-model="tainaji1.zname">

                        </th>
                    </tr>
                    <tr>
                        <th>职员手机号</th>
                        <th>
                                <input type="text"  v-model="tainaji1.phone">

                        </th>
                    </tr>
                    <tr>
                        <th>性别</th>
                        <th>
                               <input type="radio" :value="1" v-model="tainaji1.sex">男
                               <input type="radio" :value="0" v-model="tainaji1.sex">女

                        </th>
                    </tr>
                    <tr>
                        <th>家庭住址</th>
                        <th>
                                <input type="text" v-model="tainaji1.address">

                        </th>
                    </tr>

                    <tr>
                        <th>部门id</th>
                        <th>
                                <input type="text" v-model="tainaji1.bid">

                        </th>
                    </tr>
                    <tr>
                        <th>薪资</th>
                        <th>
                                <input type="text" v-model="tainaji1.price">

                        </th>
                    </tr>
                    <tr>
                        <th>绩效</th>
                        <th>
                                <input type="text" v-model="tainaji1.jiXiao">

                        </th>
                    </tr>
                   
                    <tr>
                        <th></th>
                        <th>
                               <button @click="tainaji">添加</button>

                        </th>
                    </tr>




        </table>


</template>


<script setup lang="ts">


import axios from 'axios';
import{ref}from'vue'

const tainaji1 =ref({

"zid": 0,
  "zname": "string",
  "phone": "string",
  "sex": 0,
  "address": "string",
  "bid": 0,
  "price": 0,
  "jiXiao": 0,
  "isDel": true,
  "dewltime": "2024-12-25T12:52:17.599Z",
  "addtime": "2024-12-25T12:52:17.599Z"


})


const tainaji =()=>{


    axios.post('https://localhost:7288/api/ZhiYuan/AddZy',tainaji1.value).then(res=>{

        if(res.data>0)
    {
        alert('添加成功')
    }
    else
    {
        alert('添加失败')
    }
    })

}




</script>